﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.OracleClient;
using DBUtility;//请先添加引用

namespace OracleDAL.Common
{
    /// <summary>
    /// 用于对数据库的公共操作接口
    /// qfkong 2010.10.26 17:50
    /// </summary>
    public class Common
    {
        /// <summary>
        /// 
        /// </summary>
        public Common()
        {

        }
        /// <summary>
        /// 调用分页存储过程
        /// </summary>
        /// <param name="TABLENAME">查询表名</param>
        /// <param name="FEILDS">查询字段</param>
        /// <param name="STRWHERE">查询条件</param>
        /// <param name="SORT">排序字段</param>
        /// <param name="PAGESIZE">页数</param>
        /// <param name="CURRENTPAGE">当前页码</param>
        /// <param name="ISTRANSLATION">是否翻译</param>
        /// <returns>返回当前的结果集</returns>
       /* public DataSet GetDataByPageSize(string TABLENAME, string FEILDS, string STRWHERE, string SORT, Int32 PAGESIZE, Int32 CURRENTPAGE, string ISTRANSLATION)
        {
            OracleParameter[] parameters = {
					new OracleParameter("p_tablename", OracleType.VarChar,100),
					new OracleParameter("p_feilds", OracleType.VarChar,4000),
					new OracleParameter("p_strwhere", OracleType.VarChar,4000),
					new OracleParameter("p_sort", OracleType.VarChar,1000),
					new OracleParameter("p_pagesize", OracleType.Int32 ),
					new OracleParameter("p_currentpage", OracleType.Int32 ),
					new OracleParameter("p_istranslation", OracleType.VarChar ,2 ),
					new OracleParameter("p_cursor", OracleType.Cursor )};
            parameters[0].Value = TABLENAME;
            parameters[1].Value = FEILDS;
            parameters[2].Value = STRWHERE;
            parameters[3].Value = SORT;
            parameters[4].Value = PAGESIZE;
            parameters[5].Value = CURRENTPAGE;
            parameters[6].Value = ISTRANSLATION;

            parameters[0].Direction = ParameterDirection.Input;
            parameters[1].Direction = ParameterDirection.Input;
            parameters[2].Direction = ParameterDirection.Input;
            parameters[3].Direction = ParameterDirection.Input;
            parameters[4].Direction = ParameterDirection.Input;
            parameters[5].Direction = ParameterDirection.Input;
            parameters[6].Direction = ParameterDirection.Input;
            parameters[7].Direction = ParameterDirection.Output;

            return OracleHelper.RunProcedure("P_GETRECORD_PAGE", parameters, "pageCord");
        }*/
    }
}
